<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>主页</title>
    <link rel="stylesheet" href="stylesheets/style.css">
</head>
<body>

<form action="/upload" method="post" enctype="multipart/form-data">
    <input type="text" name="id">
    <input type="file" name="file" multiple>
    <input type="submit" value="提交">
</form>

<!--<iframe src="https://view.officeapps.live.com/op/view.aspx?src=doc/test-pdf.pdf" frameborder="0" width="800" height="600"></iframe>-->

<button class="btn">结收文件</button>

<script src="js/axios.js"></script>
<script>
    // 请求需要打开的文件
    document.querySelector('.btn').onclick = () => {
        axios.get('/blob', {
            params: {
                filename: '计科2班201742010131胡伟作业5.docx'
            },
            responseType: 'blob'
        }).then(res => {
            console.log(res)
            const fd = new FileReader();
            fd.rea(res.data);
            fd.onloadend = () => {
                const blobUrl = URL.createObjectURL()

                // http%3A%2F%2Fvideo.ch9.ms%2Fbuild%2F2011%2Fslides%2FTOOL-532T_Sutter.pptx
                const template = `
                    <iframe
                    src="https://view.officeapps.live.com/op/view.aspx?src=${}"
                    frameborder="0"
                    width="800"
                    height="600"
                    ></iframe>
                `

                document.body.innerHTML = template

            }
        })
    }
</script>

</body>
</html>